package fei.yuzhi.com.loveflowers.fragment.classifyFragment;

import java.util.List;

import fei.yuzhi.com.loveflowers.bean.ClassifyAllBean;
import fei.yuzhi.com.loveflowers.bean.ClassifyItemBean;

/**
 * Created by Administrator on 2016/10/5.
 */
public class ClassifyPresenter implements ClassifyContract.ClassifyPresenter {
    private ClassifyContract.ClassifyView classifyView;
    private ClassifyContract.ClassifyModle classifyModle;
    private int id;

    public ClassifyPresenter(int id,ClassifyContract.ClassifyView classifyView) {
        this.classifyView=classifyView;
        this.classifyModle=new ClassifyModle();
        this.id=id;
    }


    @Override
    public void Connected() {


        classifyModle.getClassify(new ClassifyModle.loadClassify() {
            @Override
            public void sentClassify(List<String> list) {
                classifyView.onGetClassifySuccess(list);
            }
        });


    }

    @Override
    public void ConnectedClassifyItem() {
        classifyModle.getClassifyItemBean(id,new ClassifyModle.loadClassifyItemBean() {
            @Override
            public void sendClassifyItemBean(List<ClassifyItemBean.DatasBean.ClassListBean.ChildBean> list) {
                classifyView.onGetClassifyItemBeanSuccess(list);
            }
        });

    }

    @Override
    public void ConnectedAll() {
        classifyModle.getClassifyAllBean(new ClassifyModle.loadClassifyAllBean() {
            @Override
            public void sendClassifyAllBean(List<ClassifyAllBean.DatasBean> list) {
                classifyView.onGetClassifyAllBeanSuccess(list);
            }
        });
    }
}
